package com.itheima.d14_extends_constructor;

public class Cat {
    private String name;
    private String color;
    private int age;

    public Cat() {
        //使用无参构造方法创建对象时，让name默认是 小花，color默认是白色 ，age默认为2岁
        //        this.name = "小花";
        //        this.color = "白色";
        //        this.age = 2;

        this("小花","白色",2);
        //super(); //不能和this调用构造方法共存
    }

    public Cat(String name, String color, int age) {
        this.name = name;
        this.color = color;
        this.age = age;
    }
}
